<template>
  <div>
    <Header></Header>

    <div class="container">
      <!-- 头部标题 -->
      <div class="header">
        <h1 class="title"><i class="el-icon-position"></i>地产详情</h1>
      </div>
      <div class="content">
        <h3>{{propertList.title}}</h3>
        <div class="pic">
          <div class="left">
            <img
              :src="propertList.image"
              alt=""
            />
          </div>
          <div class="right">
            <div class="top">
              <div class="image">
              <img
                v-for="item in propertList.photos"
                :key="item"
                :src="item"
                alt=""
              />
              <!-- <img src="http://ye-1308566529.cos.ap-guangzhou.myqcloud.com/f.jpeg" alt="">
              <img src="http://ye-1308566529.cos.ap-guangzhou.myqcloud.com/f.jpeg" alt="">
              <img src="http://ye-1308566529.cos.ap-guangzhou.myqcloud.com/f.jpeg" alt="">
              <img src="http://ye-1308566529.cos.ap-guangzhou.myqcloud.com/f.jpeg" alt=""> -->
              </div>
              <div class="price">
               惊爆价: {{propertList.price}}元!!
               <p>机不可失,失不再来</p>
              </div>
            </div>
            <!-- 地图组件 -->
            <div class="bottom">
              <div>
                <Map class="map"></Map>
              </div>
            </div>
          </div>
        </div>
        <div class="footer">
          <p class="text">描述:
           {{propertList.desc}}
          </p>
        </div>
      </div>
    </div>

    <Footer></Footer>
  </div>
</template>

<script>
import Footer from "@/components/Footer.vue";
import Header from "@/components/Header.vue";
import {getpropertiesById} from '@/api/properties'
import Map from '@/components/Map.vue';
export default {
  components: { Header, Footer, Map },
  data () {
    return {
      id:this.$route.query.id,
      propertList:{}
    }
  },
 async created () {
   const res=  await getpropertiesById(this.id)
   this.propertList = res.data
   console.log('this.propertList: ', this.propertList);
  }
};
</script>


<style lang="less" scoped>
.container {
  padding: 0 30px 30px 30px;
  width: 1000px;
  height: 750px;
  margin: 0 auto;
  margin-bottom: 90px;
  .header {
    .title {
      font-size: 18px;
      color: orange;
      i {
        font-size: 20px;
        // color: orange;
        margin-right: 5px;
      }
    }
  }
  .content {
    
    margin: 10px;
    padding: 10px;
    border: 1px solid #dbdbdd;
    h3{
      text-align: center;
      margin-bottom: 10px;
      font-size: 30px;
    }
    .pic {
      display: flex;
      justify-content: space-between;
      border-bottom: 1px solid #dbdbdd;
      padding-bottom: 10px;
      height: 450px;
      .left {
        img {
          width: 600px;
          height: 100%;
          border-radius: 30px;
        }
      }
      .right {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        .top {
           width: 290px;
          .image{
            padding: 10px;
            display: flex;
            justify-content: space-between;
            align-content: space-between;
            flex-wrap: wrap;
            margin: auto;
            width: 200px;
            img {
              width: 80px;
              height: 80px;
              margin-bottom: 10px;
          border-radius: 30px;
            }
          }
          .price{
            margin-bottom: 30px;
            height: 20px;
            width: 100%;
            color: coral;
            text-align: center;
            line-height: 20px;
            font-size: 20px;
            font-weight: 600;
          }
          p {
            margin-top: 10px;
          }
        }
        .bottom {
          margin-left: 10px;
          overflow: hidden;
          width: 270px;
          padding: 5px;
          border: 1px solid #ddd;
          // box-shadow: 4px 0px 30px 0px rgba(0,0,0,0.4),
          // -15px 0px 14px -12px rgba(0,0,0,0.4),
          // 15px 0px 14px -12px rgba(0,0,0,0.4),
          // 0px 15px 14px -44px rgba(0,0,0,0.4);
          div{
            width: 100%;
            height: 100%;
            border-radius: 10px;
            overflow: hidden;
          }
        }
        
      }
    }
    .footer {
      .text {
        line-height: 40px;
        text-indent: 2em;
        margin-top: 10px;
      }
    }
  }
}
</style>